
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>TopoGroup是一个话题社区。为您提供便利。</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<link href="css/index.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
		<script type="text/javascript">
	$(document).ready(
			function() {

				var rememberme = false;

				$("input[name='submit']").click(
						function() {
							var email = $("input[name='email']").val();
							var password = $("input[name='password']").val();
							var rememberme = "false";
							if(document.all('rememberme').checked == true)
								rememberme = "true";
							$.ajax({
								type : "GET",
								url : "Login",
								data : "email=" + email + "&password="
										+ password + "&rememberme="
										+ rememberme,
								success : function(msg) {
									if (msg == "correct\r\n")
										self.location = "page/home.jsp";
										//$("#login-form").submit();
									else if (msg == "no user\r\n") {
										$(".show_login_message").text("没有该用户");
									} else if (msg == "wrong password\r\n") {
										$(".show_login_message").text("密码错误");
									}
								}
							});
						});

			});
</script>
	</head>

	<body id="login">
		<div id="page">
			<div id="login_form">
				<form method="post" action="Login" id="login-form">
					<ul class="clearfix">
						<li>
							<label for="email">
								邮箱
							</label>
							<input id="email" class="text r5px" type="email"
								placeholder="yourname@example.com" spellcheck="false"
								name="email">
						</li>
						<li>
							<label for="password">
								密码
							</label>
							<input id="password" class="text r5px" type="password"
								name="password">
						</li>
						<li class="last" style="padding: 22px 0 0 0">
							<input id="button_login" class="button_orange r5px" type="button"
								name="submit" value="登陆">
						</li>
						<li style="display:none">
							<input id="rememberme" type="checkbox" name="rememberme"
								value="remember_on">
							<label class="remember_me" for="rememberme">
								记住我
							</label>
						</li>
						<li>
							<a href="resetpassword">忘记密码？</a>
						</li>
						<li>
							<a href="page/register.jsp">注册</a>
						</li>
					</ul>
				</form>
			</div>
			<div class="show_login_message">
			</div>
		</div>
	</body>
	</body>
</html>
